<?php
DEFINE('WEBROOT',dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR);
DEFINE('PATH_SITE',		WEBROOT);
DEFINE('PATH_LIBRARY',	PATH_SITE.'library'.DIRECTORY_SEPARATOR);
DEFINE('PATH_CONTROLLER',	PATH_SITE.'controller'.DIRECTORY_SEPARATOR);

DEFINE('PATH_HELPER',	PATH_SITE.'helper'.DIRECTORY_SEPARATOR);
DEFINE('PATH_SYSTEM',	PATH_SITE.'system'.DIRECTORY_SEPARATOR);
DEFINE('PATH_MEDIA',	PATH_SITE.'media'.DIRECTORY_SEPARATOR);
DEFINE('SMARTY_DIR',	PATH_SITE.'system'.DIRECTORY_SEPARATOR.'Smarty-3.0.7'.DIRECTORY_SEPARATOR.'libs'.DIRECTORY_SEPARATOR);
if(!defined('AUTOMATION')){
	DEFINE('ROOT',			$_SERVER['SERVER_NAME']);
} else {
	DEFINE('ROOT',			R_D);
}
DEFINE('EXT',			'.php');
DEFINE('HELPER_PREFIX',	'Helper_');
DEFINE('PAGE_SIZE',		'12');

DEFINE('MESSAGE_SUCCESS', 'Operate successfully!');
DEFINE('MESSAGE_FAILURE', 'Operate unsuccessfully!');

define('RECORD_EXIST', 2001);

require_once(PATH_SYSTEM.'function.php');
require_once(PATH_SYSTEM.'object.php');
require_once(PATH_SYSTEM.'database.php');
require_once(PATH_SYSTEM.'library.php');
require_once(PATH_SYSTEM.'helper.php');
require_once(PATH_SYSTEM.'controller.php');
require_once(PATH_SYSTEM.'view.php');
require_once(PATH_SYSTEM.'log.php');
require_once(PATH_SYSTEM.'relation.php');
require_once(PATH_SYSTEM.'system.php');

require_once(PATH_SYSTEM.'multilingual'.DIRECTORY_SEPARATOR.'pomo'.DIRECTORY_SEPARATOR.'entry.php');
require_once(PATH_SYSTEM.'multilingual'.DIRECTORY_SEPARATOR.'pomo'.DIRECTORY_SEPARATOR.'mo.php');
require_once(PATH_SYSTEM.'multilingual'.DIRECTORY_SEPARATOR.'pomo'.DIRECTORY_SEPARATOR.'po.php');
require_once(PATH_SYSTEM.'multilingual'.DIRECTORY_SEPARATOR.'pomo'.DIRECTORY_SEPARATOR.'streams.php');
require_once(PATH_SYSTEM.'multilingual'.DIRECTORY_SEPARATOR.'pomo'.DIRECTORY_SEPARATOR.'translations.php');

require_once(PATH_SYSTEM.'multilingual'.DIRECTORY_SEPARATOR.'l10n.php');
require_once(PATH_SYSTEM.'multilingual'.DIRECTORY_SEPARATOR.'load.php');
require_once(PATH_SYSTEM.'multilingual'.DIRECTORY_SEPARATOR.'locale.php');
require_once(PATH_SYSTEM.'multilingual'.DIRECTORY_SEPARATOR.'plugin.php');

require_once(SMARTY_DIR.'Smarty.class.php');

load_default_textdomain();
$locale = get_locale();
//$wp_locale =& new WP_Locale();
$wp_locale = new WP_Locale();

$datacontrol = Helper::instance('DataControl');
$security = Helper::instance('Security');
$smarty = new Smarty();
?>